// *Author：jxx
// *Contact：283591387@qq.com
// *代码由框架生成,任何更改都可能导致被代码生成器覆盖
export default function(){
    const table = {
        key: 'ID',
        footer: "Foots",
        cnName: '物料基础数据',
        name: 'products',
        newTabEdit: false,
        url: "/products/",
        sortName: "ID"
    };
    const tableName = table.name;
    const tableCNName = table.cnName;
    const newTabEdit = false;
    const key = table.key;
    const editFormFields = {"ProductCode":"","ProductName":"","DrawNo":"","Unit":"","IsMaterial":"","Memo":""};
    const editFormOptions = [[{"title":"物料编码","required":true,"field":"ProductCode"},
                               {"title":"物料名称","field":"ProductName"}],
                              [{"title":"物料图号","field":"DrawNo"},
                               {"dataKey":"物料单位","data":[],"title":"计量单位","field":"Unit","type":"select"},
                               {"dataKey":"enable","data":[],"title":"是否为原材料","field":"IsMaterial","type":"switch"}],
                              [{"title":"备注信息","field":"Memo","colSize":12}]];
    const searchFormFields = {"ProductCode":"","ProductName":"","DrawNo":"","UpdateDate":[null,null]};
    const searchFormOptions = [[{"title":"物料编码","field":"ProductCode"},{"title":"物料名称","field":"ProductName"},{"title":"物料图号","field":"DrawNo"},{"title":"更新时间","field":"UpdateDate","type":"range"}]];
    const columns = [{field:'ID',title:'主键，自增ID',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'ProductCode',title:'物料编码',type:'string',width:120,require:true,align:'left'},
                       {field:'ProductName',title:'物料名称',type:'string',width:120,align:'left'},
                       {field:'DrawNo',title:'物料图号',type:'string',width:120,align:'left'},
                       {field:'Unit',title:'计量单位',type:'string',bind:{ key:'物料单位',data:[]},width:110,align:'left'},
                       {field:'IsMaterial',title:'是否为原材料',type:'bool',bind:{ key:'enable',data:[]},width:110,align:'left'},
                       {field:'Memo',title:'备注信息',type:'string',width:110,align:'left'},
                       {field:'CreatedDate',title:'创建时间',type:'datetime',width:110,align:'left'},
                       {field:'UpdateDate',title:'更新时间',type:'datetime',width:110,align:'left'},
                       {field:'CreateUser',title:'创建人',type:'string',width:120,align:'left'}];
    const detail ={columns:[]};
    const details = [];

    return {
        table,
        key,
        tableName,
        tableCNName,
        newTabEdit,
        editFormFields,
        editFormOptions,
        searchFormFields,
        searchFormOptions,
        columns,
        detail,
        details
    };
}